Public MustInherit Class ProcessReport
	Inherits Process

	Protected Columns As String = ""
	'Protected Exports As Boolean = False
	Protected Landscape As Boolean = False

	NotOverridable Overrides Sub OnPrint()
		If Columns <> "" Then Show("-List,Report") : Focus("Report")
		If Landscape Then Report.Orientation = SSD.Report.PageOrientation.Landscape
		Report.Begin()
		Buttons.Show("Reset")
	End Sub

	Overrides Sub ResetForm(Optional ByVal HardReset As Boolean = True)
		MyBase.ResetForm(HardReset)
		If Columns <> "" Then
			Show("List,-Report")
			List.DataSource = Nothing
		End If
	End Sub

	Public Overrides Function OnInitialize() As Boolean
		If Not MyBase.OnInitialize() Then Return False
		If Region0.Controls.Count > 0 Then StartBody()
		If Columns <> "" Then AddList() : List.AddColumns(Columns)
		AddReport()
		Return True
	End Function

	NotOverridable Overrides Function OnValidate() As Boolean
		If Not MyBase.OnValidate Then Return False
		If Columns <> "" Then
			List.DataSource = Rs
			Buttons.Show("Print.Reset")
		Else
			OnPrint()
		End If
	End Function

End Class